import request from '@/utils/request';

/**
 * 分页滚动加载获取关注列表
*/
export function getFollowsListApi(userId, params) {
  return request({
    url: `/follow/${userId}/following`,
    method: 'get',
    params
  });
}

/**
 * 关注用户
*/
export function followUserApi(followerId, followedId) {
  return request({
    url: '/follow',
    method: 'post',
    data: {
        followerId,
        followedId
    }
  });
}

/**
 * 取消关注用户
*/
export function unfollowUserApi(followerId, followedId) {
  return request({
    url: `/follow/unfollow`,
    method: 'post',
    data: {
        followerId,
        followedId
    }
  });
}

/**
 * 分页滚动加载获取粉丝列表
*/
export function getFansListApi(userId, params) {
  return request({
    url: `/follow/${userId}/followers`,
    method: 'get',
    params
  });
}